var obj = {
    //私有属性(js没有严格意义的私有属性)
    _age:18,
}

Object.defineProperties(obj,{
    name:{
        enumerable:true,
        configurable:true,
        writable:true,
        value:"why"
    },
    age:{
        configurable:false,
        enumerable:false,
        get:function () {
            console.log("输出age");
            return this._age
        },
        set:function (value) {
            this._age = value
        }
    }
})

console.log(obj._age)
console.log(obj.age);
